package him.action.factory;

import him.action.Action;
import him.action.ActionFactory;
import him.action.login.LoginAction;
import him.action.login.LoginpageAction;
import him.action.login.LogoutAction;

public class LoginActionFactory implements ActionFactory {
	private static LoginActionFactory factory;
	
	public static LoginActionFactory getInstance(){
		if (factory==null) {
			factory=new LoginActionFactory();
		}
		return factory;
	}
	@Override
	public Action getAction(String command) {
		Action action = null;
		if (command.equalsIgnoreCase("login")) {
			action=new LoginAction();
		}else if(command.equalsIgnoreCase("loginpage")){
			action=new LoginpageAction();
		}else if(command.equalsIgnoreCase("logout")){
			action=new LogoutAction();
		}
		return action;
	}

}
